package com.example.demo;

import java.sql.SQLOutput;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author shkstart
 * @create 2023-02-24-23:44
 */
public class Test {
    public static void main(String[] args){
        long d[] = new long[21]; // 错排数据
        d[0] = d[1] = 0;
        d[2] = 1;
        long f[] = new long[21]; // 阶乘
        f[0] = f[1] = 1;
        f[2] = 2;
// 算N错排数据和阶乘
        for(int i = 3; i <= 20; ++i){
            d[i] = (i-1) * (d[i-1] + d[i-2]);
            f[i] = i * f[i-1];
        }
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = sc.nextInt();
            System.out.printf("%.2f%%\n", 100.0*d[n]/f[n]);
        }
    }
}